package com.xizhi.zomprogress.dao.mapper;


import com.xizhi.zomprogress.bean.User;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;
import java.sql.SQLException;


/**
 *
 * @author xiaomin
 * @date 2018/4/12
 */
@Repository
public class UserMapper implements RowMapper<User> {

    @Nullable
    @Override
    public User mapRow(ResultSet resultSet, int i) throws SQLException {
        User bean = new User();
        bean.setId(resultSet.getInt("id"));
        bean.setUserName(resultSet.getString("user_name"));
        bean.setUserImage(resultSet.getString("user_image"));
        bean.setInvitedUser(resultSet.getString("invited_user"));
        bean.setSignedUser(resultSet.getString("signed_user"));
        bean.setAlreadyObtain(resultSet.getString("already_obtain"));
        return bean;
    }
}
